<?php

class krt_tNG_insert extends krt_tNG {

	function krt_tNG_insert($connection) {
		parent::krt_tNG($connection);
		$this->type = '_insert';
	}
	
	function addColumn($colName, $type, $method, $reference, $null) {
		$tmpVal = KT_getRealValue($method, $reference);
		if ($tmpVal != NULL) {
			$this->fields[$colName] = $tmpVal;
			$this->sessionID = $this->fields[$colName];
		}
	}
	
	
	/**
		This function is executed after the BEFORE triggers and just before the real SQL transaction
		We don't have a real SQL transaction so we will use this function to perform our Kart IU tasks
	*/
	function prepareSQL() {
		if (isset($_SESSION[$this->sessionID])) {
			$this->mxKart->addToKart($_SESSION[$this->sessionID]);
		} else {
			//$this->errorNo = KT_TRANSACTION_FAILED;
			//$this->errorMsg = 'Session has expired!';
		}
		
		$this->mxKart->UpdateKart();
	}
	
}

?>
